<?php

/**
 * RendicionDetalle form base class.
 *
 * @package    form
 * @subpackage rendicion_detalle
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 8508 2008-04-17 17:39:15Z fabien $
 */
class BaseRendicionDetalleForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'             => new sfWidgetFormInputHidden(),
      'dias'           => new sfWidgetFormInput(),
      'dinero_dia'     => new sfWidgetFormInput(),
      'gastos'         => new sfWidgetFormInput(),
      'total'          => new sfWidgetFormInput(),
      'menos_anticipo' => new sfWidgetFormInput(),
      'cobrar'         => new sfWidgetFormInput(),
      'devolver'       => new sfWidgetFormInput(),
      'id_rendicion'   => new sfWidgetFormDoctrineSelect(array('model' => 'Rendicion', 'add_empty' => false)),
      'id_afiliado'    => new sfWidgetFormDoctrineSelect(array('model' => 'Afiliado', 'add_empty' => false)),
    ));

    $this->setValidators(array(
      'id'             => new sfValidatorDoctrineChoice(array('model' => 'RendicionDetalle', 'column' => 'id', 'required' => false)),
      'dias'           => new sfValidatorInteger(),
      'dinero_dia'     => new sfValidatorInteger(),
      'gastos'         => new sfValidatorInteger(),
      'total'          => new sfValidatorInteger(),
      'menos_anticipo' => new sfValidatorInteger(),
      'cobrar'         => new sfValidatorInteger(),
      'devolver'       => new sfValidatorInteger(),
      'id_rendicion'   => new sfValidatorDoctrineChoice(array('model' => 'Rendicion')),
      'id_afiliado'    => new sfValidatorDoctrineChoice(array('model' => 'Afiliado')),
    ));

    $this->widgetSchema->setNameFormat('rendicion_detalle[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'RendicionDetalle';
  }

}